package 位运算;

/**
 * @description:
 * @author: 小白白
 * @create: 2021-10-14
 **/

public class No371两整数之和 {

    public int getSum(int a, int b) {

        while (a != 0) {
            int temp1 = (a & b) << 1;
            int temp2 = a ^ b;
            a = temp1;
            b = temp2;
        }

        return b;
    }

    public static void main(String[] args) {
        No371两整数之和 n = new No371两整数之和();
        int result = n.getSum(3, 7);
        System.out.println(result);
    }

}
